/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.sac.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Colao
 */
@Embeddable
public class AsociacionGarantiaCreditoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "FID_GAR_GARANTIA", nullable = false)
    private long fidGarGarantia;
    @Basic(optional = false)
    @Column(name = "FID_SAC_ESTADO_GARANTIA_ASOCIADA", nullable = false)
    private long fidSacEstadoGarantiaAsociada;

    public AsociacionGarantiaCreditoPK() {
    }

    public AsociacionGarantiaCreditoPK(long fidGarGarantia, long fidSacEstadoGarantiaAsociada) {
        this.fidGarGarantia = fidGarGarantia;
        this.fidSacEstadoGarantiaAsociada = fidSacEstadoGarantiaAsociada;
    }

    public long getFidGarGarantia() {
        return fidGarGarantia;
    }

    public void setFidGarGarantia(long fidGarGarantia) {
        this.fidGarGarantia = fidGarGarantia;
    }

    public long getFidSacEstadoGarantiaAsociada() {
        return fidSacEstadoGarantiaAsociada;
    }

    public void setFidSacEstadoGarantiaAsociada(long fidSacEstadoGarantiaAsociada) {
        this.fidSacEstadoGarantiaAsociada = fidSacEstadoGarantiaAsociada;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) fidGarGarantia;
        hash += (int) fidSacEstadoGarantiaAsociada;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AsociacionGarantiaCreditoPK)) {
            return false;
        }
        AsociacionGarantiaCreditoPK other = (AsociacionGarantiaCreditoPK) object;
        if (this.fidGarGarantia != other.fidGarGarantia) {
            return false;
        }
        if (this.fidSacEstadoGarantiaAsociada != other.fidSacEstadoGarantiaAsociada) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.sac.be.AsociacionGarantiaCreditoPK[fidGarGarantia=" + fidGarGarantia + ", fidSacEstadoGarantiaAsociada=" + fidSacEstadoGarantiaAsociada + "]";
    }

}
